#include <iostream>
#include "httplib.h"

#define SEVER_IP "124.70.203.1"
#define SERVER_PORT 9000

int main()
{
    httplib::Client cli("124.70.203.1", SERVER_PORT);
    httplib::MultipartFormData file;
    file.name = "name1";        // 要与服务器那边的对应上
    file.filename = "hello.txt";
    file.content = "this is hello.txt content, test, test, test....\ntest\ntest\n";
    file.content_type = "text/plain";
    httplib::MultipartFormDataItems items;      // 这是一个MultipartFormData数组
    items.push_back(file);
    if(auto res = cli.Post("/multipart", items)) {
        std::cout << res->status << '\n';
        std::cout << res->body << '\n';
    } else {
        auto err = res.error();
        std::cerr << "HTTP error: " << httplib::to_string(err) << std::endl;
        return 1;
    }
    return 0;
}